Skip to content

Conversation

@reinrich
Copy link
Member

@reinrich reinrich commented Jan 27, 2025

This pr changes Matcher::misaligned_vectors_ok to return true on PPC64 for better vectorization during SuperWord.
IR checking of the corresponding test TestCastX2NotProcessedIGVN.java is also enabled.

Tested with TestCastX2NotProcessedIGVN.java

The change passed our CI testing:
Tier 1-4 of hotspot and jdk. All of langtools and jaxp. Renaissance Suite and SAP specific tests.
Testing was done on the main platforms and also on Linux/PPC64le and AIX.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issues

  • JDK-8348678: [PPC64] C2: unaligned vector load/store is ok (Enhancement - P4)
  • JDK-8343906: test2 of compiler/c2/TestCastX2NotProcessedIGVN.java fails on some platforms (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23318/head:pull/23318
$ git checkout pull/23318

Update a local copy of the PR:
$ git checkout pull/23318
$ git pull https://git.openjdk.org/jdk.git pull/23318/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23318

View PR using the GUI difftool:
$ git pr show -t 23318

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23318.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 27, 2025

👋 Welcome back rrich! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jan 27, 2025

@reinrich This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8348678: [PPC64] C2: unaligned vector load/store is ok
8343906: test2 of compiler/c2/TestCastX2NotProcessedIGVN.java fails on some platforms

Reviewed-by: mdoerr, amitkumar

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 40 new commits pushed to the master branch:

  • cbe9ec5: 8348905: Add support to specify the JDK for compiling Jtreg tests
  • 6b581d2: 8347997: assert(false) failed: EA: missing memory path
  • 4662363: 8348687: [BACKOUT] C2: Non-fluid StringBuilder pattern bails out in OptoStringConcat
  • d266ca9: 8348752: Enable -XX:+AOTClassLinking by default when -XX:AOTMode is specified
  • cbc89a7: 8348898: Remove unused OctalDigits to clean up code
  • 96fefed: 8319850: PrintInlining should print which methods are late inlines
  • 51cce6e: 8318577: Windows Look-and-Feel JProgressBarUI does not render correctly on 2x UI scale
  • 6bfae3a: 8333386: TestAbortOnVMOperationTimeout test fails for client VM
  • f98d9a3: 8348870: Eliminate array bound checks in DecimalDigits
  • fe6d9ab: 8348582: Set -fstack-protector when building with clang
  • ... and 30 more: https://git.openjdk.org/jdk/compare/ad01dfb670215a35d4151c7129c9086888e1f9e8...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@reinrich
Copy link
Member Author

/issue JDK-8343906

@openjdk
Copy link

openjdk bot commented Jan 27, 2025

@reinrich
Adding additional issue to issue list: 8343906: test2 of compiler/c2/TestCastX2NotProcessedIGVN.java fails on some platforms.

@openjdk
Copy link

openjdk bot commented Jan 27, 2025

@reinrich The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Jan 27, 2025
@reinrich reinrich marked this pull request as ready for review January 27, 2025 16:18
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 27, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 27, 2025

Webrevs

@reinrich
Copy link
Member Author

@offamitkumar JDK-8343906 states that the test also fails on s390x.
This must have another reason then since misaligned_vectors_ok returns already true on s390x:

// z/Architecture does support misaligned store/load at minimal extra cost.
static constexpr bool misaligned_vectors_ok() {
return true;
}

Copy link
Contributor

@TheRealMDoerr TheRealMDoerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for bringing this up to date!
The old code was for Power7. ISA V2.06 specified "If EA is not word-aligned (that is, EA{62:63}g0b00),
the system alignment error handler is permitted to be invoked instead of performing the storage access."
This was updated for Power8. ISA V2.07 removed that limitation and we require Power8 for SuperwordUseVSX. So, arbitrary alignment is ok.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 27, 2025
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Jan 29, 2025
@TheRealMDoerr
Copy link
Contributor

Should AlignVector be disabled regardless of the Power Architecture version? SuperwordUseVSX already requires Power8. The 8 Byte load/store instructions which are used otherwise have no alignment requirements, either. But, Power7 is basically dead and the support will probably be removed, soon (https://bugs.openjdk.org/browse/JDK-8331859). So, I'm ok with it.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 29, 2025
@reinrich
Copy link
Member Author

Thanks for looking at this.

Should AlignVector be disabled regardless of the Power Architecture version? SuperwordUseVSX already requires Power8. The 8 Byte load/store instructions which are used otherwise have no alignment requirements, either.

Ah, indeed. But I think there's an issue though with the displacement which needs to be 4 byte aligned, doesn't it? Maybe that's why AlignVector wasn't disabled yet.
And maybe there's even an issue with +SuperwordUseVSX if nodes with n->as_LoadVector()->memory_size() == 8 are generated?

@TheRealMDoerr
Copy link
Contributor

The displacement should be handled by the memoryAlg4 operands. (Should be checked.) It may make sense to switch off AlignVector even without SuperwordUseVSX (on any Power Architecture).

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Jan 29, 2025
@reinrich
Copy link
Member Author

The displacement should be handled by the memoryAlg4 operands. (Should be checked.)

Of course. I should play more often with them AD files.

It may make sense to switch off AlignVector even without SuperwordUseVSX (on any Power Architecture).

Done.
I've looked at a little example where bytes from a long[] are copied to a byte[] varying a constant offset. The stores were always merged into a std instruction independently of AlignVector also I couldn't get it to use 16 byte load/stores. Would be interesting to find out why...

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 29, 2025
@reinrich
Copy link
Member Author

Thanks for the reviews.
/integrate

@openjdk
Copy link

openjdk bot commented Feb 11, 2025

Going to push as commit 1a8212e.
Since your change was applied there have been 170 commits pushed to the master branch:

  • 41bdc47: 8208377: Soft hyphens render if not using TextLayout
  • df654a9: 8349752: Tier1 build failure caused by JDK-8349178
  • 527489c: 8349284: Make libExplicitAttach work on static JDK
  • f11a737: 8349475: Test tools/javac/api/TestJavacTaskWithWarning.java writes files in src dir
  • b737f7f: 8349501: Relocate supporting classes in security/testlibrary to test/lib/jdk tree
  • 84b32cb: 8349178: runtime/jni/atExit/TestAtExit.java should be supported on static JDK
  • ab66c82: 8349639: jfr/event/gc/detailed/TestShenandoahEvacuationInformationEvent.java fails to compile after JDK-8348610
  • f74c4df: 8349580: Do not use address in MemTracker top level functions
  • c9cadbd: 8346567: Make Class.getModifiers() non-native
  • 5589892: 8343074: test/jdk/com/sun/net/httpserver/docs/test1/largefile.txt could be generated
  • ... and 160 more: https://git.openjdk.org/jdk/compare/ad01dfb670215a35d4151c7129c9086888e1f9e8...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 11, 2025
@openjdk openjdk bot closed this Feb 11, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 11, 2025
@openjdk
Copy link

openjdk bot commented Feb 11, 2025

@reinrich Pushed as commit 1a8212e.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@reinrich reinrich deleted the 8348678_ppc_misaligned_vectors_are_ok branch October 24, 2025 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants